package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 林地指标交易平台_交易申请相关文件 实体类。
 *
 * @author 11987
 * @since 2025-04-27
 */
@Table(value = "LINDI_TRADE_APPLICATION_FILE", onInsert = InsertFullColumnHandler.class
        , onUpdate = UpdateFullColumnHandler.class)
public class LindiTradeApplicationFile extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 交易申请相关文件ID
     */
    private Long tradeApplicationFileId;

    /**
     * 交易申请ID
     */
    private Long tradeApplicationId;

    /**
     * 文件类型
     */
    private Integer fileType;

    // 无参构造函数
    public LindiTradeApplicationFile() {
        super();
    }

    // 全参构造函数
    public LindiTradeApplicationFile(Long tradeApplicationFileId, Long tradeApplicationId, Integer fileType) {
        super();
        this.tradeApplicationFileId = tradeApplicationFileId;
        this.tradeApplicationId = tradeApplicationId;
        this.fileType = fileType;
    }

    // Getter和Setter方法
    public Long getTradeApplicationFileId() {
        return tradeApplicationFileId;
    }

    public void setTradeApplicationFileId(Long tradeApplicationFileId) {
        this.tradeApplicationFileId = tradeApplicationFileId;
    }

    public Long getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    public Integer getFileType() {
        return fileType;
    }

    public void setFileType(Integer fileType) {
        this.fileType = fileType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiTradeApplicationFile that = (LindiTradeApplicationFile) o;
        return Objects.equals(tradeApplicationFileId, that.tradeApplicationFileId) &&
               Objects.equals(tradeApplicationId, that.tradeApplicationId) &&
               Objects.equals(fileType, that.fileType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), tradeApplicationFileId, tradeApplicationId, fileType);
    }

    @Override
    public String toString() {
        return "LindiTradeApplicationFile{" +
                "tradeApplicationFileId=" + tradeApplicationFileId +
                ", tradeApplicationId=" + tradeApplicationId +
                ", fileType=" + fileType +
                "} " + super.toString();
    }

    // Builder类
    public static class Builder {
        private Long tradeApplicationFileId;
        private Long tradeApplicationId;
        private Integer fileType;

        public Builder tradeApplicationFileId(Long tradeApplicationFileId) {
            this.tradeApplicationFileId = tradeApplicationFileId;
            return this;
        }

        public Builder tradeApplicationId(Long tradeApplicationId) {
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public Builder fileType(Integer fileType) {
            this.fileType = fileType;
            return this;
        }

        public LindiTradeApplicationFile build() {
            return new LindiTradeApplicationFile(tradeApplicationFileId, tradeApplicationId, fileType);
        }
    }

    public static Builder builder() {
        return new Builder();
    }

}
